import React from 'react'
import {NavBar,Icon} from "antd-mobile"
import {withRouter} from "react-router-dom"
 function Header(props) {
     let {title,back}=props;
    return (
        <NavBar
          mode="dark"
          icon={back?<Icon type="left" />:null}
          onLeftClick={() => props.history.goBack()}
        >
          {title}
        </NavBar>
    )
}
export default withRouter(Header)
